package com.salelogistics.basic.service.impl;

import java.util.List;
import com.salelogistics.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.salelogistics.basic.mapper.BasLotMapper;
import com.salelogistics.basic.domain.BasLot;
import com.salelogistics.basic.service.IBasLotService;

/**
 * 标段Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-09
 */
@Service
public class BasLotServiceImpl implements IBasLotService 
{
    @Autowired
    private BasLotMapper basLotMapper;

    /**
     * 查询标段
     * 
     * @param id 标段主键
     * @return 标段
     */
    @Override
    public BasLot selectBasLotByCode(Long id)
    {
        return basLotMapper.selectBasLotByCode(id);
    }

    /**
     * 查询标段列表
     * 
     * @param basLot 标段
     * @return 标段
     */
    @Override
    public List<BasLot> selectBasLotList(BasLot basLot)
    {
        return basLotMapper.selectBasLotList(basLot);
    }

    /**
     * 新增标段
     * 
     * @param basLot 标段
     * @return 结果
     */
    @Override
    public int insertBasLot(BasLot basLot)
    {
        basLot.setCreateTime(DateUtils.getNowDate());
        return basLotMapper.insertBasLot(basLot);
    }

    /**
     * 修改标段
     * 
     * @param basLot 标段
     * @return 结果
     */
    @Override
    public int updateBasLot(BasLot basLot)
    {
        return basLotMapper.updateBasLot(basLot);
    }

    /**
     * 批量删除标段
     * 
     * @param codes 需要删除的标段主键
     * @return 结果
     */
    @Override
    public int deleteBasLotByCodes(String[] codes)
    {
        return basLotMapper.deleteBasLotByCodes(codes);
    }

    /**
     * 删除标段信息
     * 
     * @param code 标段主键
     * @return 结果
     */
    @Override
    public int deleteBasLotByCode(String code)
    {
        return basLotMapper.deleteBasLotByCode(code);
    }
}
